/* 全局样式 */
.web3-wallet {
  width: 100%;
  margin: 0;
  padding: 10px; /* 减少全局 padding */
  font-family: 'Roboto', sans-serif;
  background: linear-gradient(135deg, #1e1e2f 0%, #2a2a42 100%);
  min-height: 100vh;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* 头部 */
.wallet-header {
  padding: 10px; /* 减少 padding */
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  text-align: center;
  backdrop-filter: blur(10px);
  margin-bottom: 10px; /* 减少底部间距 */
}

.wallet-header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(90deg, #00d4ff, #ff007a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.account-info {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
  font-size: 12px;
  color: #b0b0ff;
  flex-wrap: wrap;
}

.account-info span {
  word-break: break-all;
}

.refresh-btn {
  margin-left: 10px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: transform 0.3s;
}

.refresh-btn:hover:not(:disabled) {
  transform: rotate(360deg);
}

.refresh-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.qr-code {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.qr-code h3 {
  font-size: 14px;
  margin: 0 0 8px;
  color: #b0b0ff;
}

/* 错误消息 */
.error-message {
  background: rgba(255, 75, 75, 0.2);
  color: #ff9999;
  padding: 8px;
  margin: 8px 0;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #ff6666;
  font-size: 14px;
}

/* 余额和信息部分 */
.balance-section {
  display: flex;
  flex-direction: column;
  gap: 10px; /* 减少间距 */
  width: 100%;
}

.balance-card,
.info-card,
.action-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px; /* 统一 padding */
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  width: 100%;
  box-sizing: border-box;
}

.balance-card h2,
.info-card h2,
.action-card h3 {
  font-size: 16px;
  color: #b0b0ff;
  margin: 0 0 8px;
}

.balance-item,
.info-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0; /* 减少 padding */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
}

.balance-item span:first-child,
.info-item span:first-child {
  color: #d0d0ff;
  font-weight: 500;
}

.balance-item span:last-child,
.info-item span:last-child {
  color: #fff;
  font-weight: 700;
}

.balance-item span:last-child {
  font-size: 20px;
}

/* 操作部分 */
.action-section {
  margin: 10px 0; /* 减少外边距 */
  width: 100%;
}

.action-card {
  margin-bottom: 10px; /* 减少底部间距 */
}

.input-group {
  position: relative;
  margin-bottom: 8px; /* 减少间距 */
}

.input-group input {
  width: 100%;
  padding: 10px 40px 10px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  box-sizing: border-box;
  transition: background 0.3s;
}

.input-group input:focus {
  background: rgba(255, 255, 255, 0.15);
  outline: none;
}

.input-group input:disabled {
  opacity: 0.5;
}

.input-group .unit {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #b0b0ff;
  font-size: 12px;
}

.convert-info {
  font-size: 12px;
  color: #00d4ff;
  margin-bottom: 8px;
  text-align: center;
}

.action-card button {
  width: 100%;
  padding: 10px;
  background: linear-gradient(90deg, #00d4ff, #7b00ff);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.action-card button:hover:not(:disabled) {
  transform: scale(1.02);
}

.action-card button:disabled {
  background: rgba(255, 255, 255, 0.2);
  opacity: 0.7;
  cursor: not-allowed;
}

.owner-actions {
  display: flex;
  flex-direction: column;
  gap: 10px; /* 减少间距 */
  width: 100%;
}

/* 底部 */
.wallet-footer {
  text-align: center;
  padding: 8px; /* 减少 padding */
  font-size: 12px;
  color: #b0b0ff;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  margin-top: auto;
}

/* 媒体查询 - 手机端适配 */
@media (max-width: 480px) {
  .web3-wallet {
    padding: 5px; /* 进一步减少全局 padding */
  }

  .wallet-header {
    padding: 5px; /* 减少 padding */
    margin-bottom: 5px; /* 减少底部间距 */
  }

  .wallet-header h1 {
    font-size: 20px; /* 保持大小不变 */
  }

  .account-info {
    font-size: 12px; /* 保持大小不变 */
    flex-direction: row; /* 改为横向排列，减少空白 */
    gap: 5px;
    margin-top: 5px;
  }

  .refresh-btn {
    margin-left: 5px;
    padding: 5px 10px; /* 保持大小不变 */
  }

  .qr-code {
    margin-top: 5px; /* 减少顶部间距 */
  }

  .qr-code h3 {
    font-size: 14px; /* 保持大小不变 */
    margin-bottom: 5px;
  }

  .error-message {
    padding: 5px;
    margin: 5px 0;
    font-size: 14px; /* 保持大小不变 */
  }

  .balance-section {
    gap: 5px; /* 减少间距 */
  }

  .balance-card,
  .info-card,
  .action-card {
    padding: 10px; /* 保持大小不变 */
    margin-bottom: 5px; /* 减少底部间距 */
  }

  .balance-card h2,
  .info-card h2,
  .action-card h3 {
    font-size: 16px; /* 保持大小不变 */
  }

  .balance-item,
  .info-item {
    font-size: 14px; /* 保持大小不变 */
    padding: 6px 0;
  }

  .balance-item span:last-child {
    font-size: 20px; /* 保持大小不变 */
  }

  .action-section {
    margin: 5px 0; /* 减少外边距 */
  }

  .input-group input {
    padding: 10px 40px 10px 12px; /* 保持大小不变 */
    font-size: 14px; /* 保持大小不变 */
  }

  .input-group .unit {
    font-size: 12px; /* 保持大小不变 */
  }

  .convert-info {
    font-size: 12px; /* 保持大小不变 */
    margin-bottom: 8px;
  }

  .action-card button {
    padding: 10px; /* 保持大小不变 */
    font-size: 14px; /* 保持大小不变 */
  }

  .owner-actions {
    gap: 5px; /* 减少间距 */
  }

  .wallet-footer {
    padding: 5px; /* 减少 padding */
    font-size: 12px; /* 保持大小不变 */
    margin-top: 5px; /* 减少顶部间距 */
  }
}